package com.zscat.mallplus.qsg;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.*;

@Data
@TableName("qsg_store")
public class QsgStore implements Comparable<QsgStore> {
    @TableId(value = "id",type= IdType.AUTO)
    private Integer id;

    private Date createTime;

    private String servicePhone;

    private String addressLat;

    private String contactName;

    private String name;

    private String description;

    private String logo;

    private String supportName;

    private String longitude;

    private String latitude;

    private String profitSharing;

    private String mchId;

    @TableField("server_mch_id")
    private String serverMchId;

    @TableField("server_cert_path")
    private String serverCertPath;

    private String serverKey;

    private String scale;

    @TableField(exist = false)
    private String distance;
    @TableField(exist = false)
    private BigDecimal realdistance;

    private String onlineTime;

    private String onlineStatus;

    private String notice;

    private String isDandian;

    @TableField(value = "open_shop_uuid")
    private String openShopUuid;

    @TableField(value = "douyin_poi_id")
    private String douyinPoiid;

    private int dasaoTime;

    private String douyinAppid;

    private String douyinSecret;

    private String douyinToken;

    private String meituanAppid;

    private String meituanAppsecret;

    private String meituanSession;

    private String meituanRedirect;

    @TableField(exist = false)
    List<String> imgs;

    @TableField(value = "img1")
    private String img1;
    @TableField(value = "img2")
    private String img2;
    @TableField(value = "img3")
    private String img3;

    @TableField(exist = false)
    protected String storeName;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        QsgStore store = (QsgStore) o;
        return id.equals(store.id);
    }

    @Override
    public int compareTo(QsgStore o) {
        return this.realdistance.compareTo(o.getRealdistance());
    }
}